home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.10 Oct 88 / MSSourcesLong / MSPROC3.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-20  |  908 b   |  47 lines  |  [TEXT/EDIT]

  1. #Options +B +E -G -H +J +K +Z
  2. #asm
  3. .verbose
  4. #endasm
  5. #include "MyTools.p"
  6. #include "MS.h"
  7. //============================
  8. MSPROC3(theMSP,menuID,itemNumber,flg)
  9.     MSPtr                theMSP;
  10.     short                menuID;
  11.     short                itemNumber,flg;
  12. //=========================
  13. BEGIN_FCT
  14.     int                i,j,k;
  15.     short                limTab[2];
  16.     char                s1[256],s2[256];
  17.  
  18.     IF (NOT MSParsePROC(theMSP,0,&limTab[0]))
  19.     THEN
  20.         return (_MSMIVTER-1);
  21.     ELSE
  22.         FOR (i=limTab[0];i LE limTab[1];i++)
  23.             if (theMSP->MVT[i].opCode EQ _MVMENLIN)
  24.                 continue;
  25.             GetItem(theMSP->MH,i,s1);
  26.             PtoCstr(s1);
  27.             j=NULL;
  28.             while (NOT isdigit(*(s1+j)) AND j LT strlen(s1))
  29.                     j++;
  30.             IF (j LT strlen(s1))
  31.             THEN
  32.                 k=NULL;
  33.                 WHILE (isdigit(*(s1+j)) AND j LT strlen(s1))
  34.                     *(s2+k)=*(s1+j);
  35.                     j++;k++;
  36.                 ENDWHILE
  37.                 *(s2+k)='\0';
  38.                 CtoPstr(s2);
  39.                 StringToNum(s2,&k);
  40.                 *((*theMSP->MIVTH)+i)=k;
  41.             ENDIF
  42.         ENDFOR
  43.         return (_MSMIVTOK);
  44.     ENDIF
  45. END_FCT
  46. main()
  47. {}